<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      body {
        background-color: #000;
      }
      #box {
        border-radius: 5px;
        margin: 20px auto;
        width: 220px;
        padding: 20px;
        height: 280px;
        background-color: #fff;
      }
      #bigImg {
        float: left;
        margin-right: 10px;
      }
      img {
        margin: 0;
        padding: 0;
        border-radius: 5px;
      }
    </style>
  </head>
  <body>
    <div id="box">
      <div id="bigImg">
        <img src="./image/big_2.jpg" alt="" />
      </div>
      <img src="./image/small_1.jpg" alt="" />
      <img src="./image/small_2.jpg" alt="" />
      <img src="./image/small_3.jpg" alt="" />
      <img src="./image/small_4.jpg" alt="" />
      <img src="./image/small_5.jpg" alt="" />
      <img src="./image/small_6.jpg" alt="" />
      <img src="./image/small_7.jpg" alt="" />
      <img src="./image/small_8.jpg" alt="" />
      <img src="./image/small_9.jpg" alt="" />
      <img src="./image/small_10.jpg" alt="" />
      <img src="./image/small_11.jpg" alt="" />
    </div>
  </body>

  <script>
    window.onload = function () {
      var bigImg = document.getElementById("box").getElementsByTagName("img");

      for (var i = 1; i < bigImg.length; i++) {
        bigImg[i].index = i;
        bigImg[i].onmouseover = function () {
          bigImg[0].src = "./image/big_" + this.index + ".jpg";
        };
      }
    };
  </script>
</html>
